<?php
class SelectCboROE extends CommonDAO {
	
	private $sqlSelect= ' SELECT U.`ID_REQ_UNIVERSITY`, U.`NAME_P` FROM REQ_LC_UNIVERSITY LCU, REQ_UNIVERSITY U WHERE U.ID_REQ_UNIVERSITY = LCU.ID_REQ_UNIVERSITY AND LCU.ID_REQ_LC = ';
	
	public function SemesterDAO($pdbConnection){
		$this->setDBConnection($pdbConnection);
	}
	
	public function getValuesUniversityByLC($lc){
		$this->sqlSelect = $this->sqlSelect . $lc ;
		$db = $this->getDBConnection();
		$stmt=$db->exec($this->sqlSelect);
		$lovTO = new LovTO(); 
		$lst = new ArrayList();
		
		while ($row=$db->getRow($stmt,0)){
			$lovTO = $this->bindValuesUniversityByLC($row);
	   		$lst->add($lovTO);
		}
		return $lst;
	}

	/**
	 * Map the columns into Value Object representation
	 * @param $row
	 * @return SemesterVO
	 */
	private function bindValuesUniversityByLC($row){
		$lovTO = new LovTO();
		$lovTO->value = $row['ID_REQ_UNIVERSITY'];
		$lovTO->name = $lovTO->text = $row['NAME_P'];  
		return $lovTO;
	}
}